package com.yzyz.web.controller.visitor;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.yzyz.bean.route.RouteBean;
import com.yzyz.service.IRouteService;

/**
 * 搜索行程
 * @author David Sun
 * @Date   2010-4-14
 *
 */
public class SearchRouteController extends AbstractController {
	private IRouteService routeService;
	public void setRouteService(IRouteService routeService) {
		this.routeService = routeService;
	}
	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String keyWords = request.getParameter("keyWords");
		List<RouteBean> routes = this.routeService.search(keyWords);
		ModelAndView mv = new ModelAndView("/Route/Search/searchResult.jsp");
		mv.addObject("searchResult", routes);
		return mv;
	}

}
